package com.kevin.flyweight;

import java.util.HashMap;

/**
 * 享元工厂类
 *
 * @author kevin
 * @date 2025/8/21
 */
public class FlyWeightFactory {

    private HashMap<String, FlyWeight> flyWeights = new HashMap<>();

    public FlyWeight getFlyWeight(String key)
    {
        return flyWeights.computeIfAbsent(key, ConcreteFlyWeight::new);
    }
}
